<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Containers (GNU Compiler Collection (GCC) Internals)</title>

<meta name="description" content="Containers (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="Containers (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Tree-overview.html" rel="up" title="Tree overview">
<link href="Identifiers.html" rel="prev" title="Identifiers">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en">
<div class="subsection-level-extent" id="Containers">
<div class="nav-panel">
<p>
Previous: <a href="Identifiers.html" accesskey="p" rel="prev">Identifiers</a>, Up: <a href="Tree-overview.html" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Containers-1"><span>11.2.3 Containers<a class="copiable-link" href="#Containers-1"> &para;</a></span></h4>
<a class="index-entry-id" id="index-container"></a>
<a class="index-entry-id" id="index-list"></a>
<a class="index-entry-id" id="index-vector"></a>
<a class="index-entry-id" id="index-TREE_005fLIST"></a>
<a class="index-entry-id" id="index-TREE_005fVEC"></a>
<a class="index-entry-id" id="index-TREE_005fPURPOSE"></a>
<a class="index-entry-id" id="index-TREE_005fVALUE"></a>
<a class="index-entry-id" id="index-TREE_005fVEC_005fLENGTH"></a>
<a class="index-entry-id" id="index-TREE_005fVEC_005fELT"></a>

<p>Two common container data structures can be represented directly with
tree nodes.  A <code class="code">TREE_LIST</code> is a singly linked list containing two
trees per node.  These are the <code class="code">TREE_PURPOSE</code> and <code class="code">TREE_VALUE</code>
of each node.  (Often, the <code class="code">TREE_PURPOSE</code> contains some kind of
tag, or additional information, while the <code class="code">TREE_VALUE</code> contains the
majority of the payload.  In other cases, the <code class="code">TREE_PURPOSE</code> is
simply <code class="code">NULL_TREE</code>, while in still others both the
<code class="code">TREE_PURPOSE</code> and <code class="code">TREE_VALUE</code> are of equal stature.)  Given
one <code class="code">TREE_LIST</code> node, the next node is found by following the
<code class="code">TREE_CHAIN</code>.  If the <code class="code">TREE_CHAIN</code> is <code class="code">NULL_TREE</code>, then
you have reached the end of the list.
</p>
<p>A <code class="code">TREE_VEC</code> is a simple vector.  The <code class="code">TREE_VEC_LENGTH</code> is an
integer (not a tree) giving the number of nodes in the vector.  The
nodes themselves are accessed using the <code class="code">TREE_VEC_ELT</code> macro, which
takes two arguments.  The first is the <code class="code">TREE_VEC</code> in question; the
second is an integer indicating which element in the vector is desired.
The elements are indexed from zero.
</p>

</div>



</body>
</html>
